package com.cicc.beergamevirtualsimulationsystem.service.recordInit;

import cn.hutool.core.util.ObjUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.cicc.beergamevirtualsimulationsystem.entity.RecordDetailEntity;
import com.cicc.beergamevirtualsimulationsystem.entity.RecordEntity;
import com.cicc.beergamevirtualsimulationsystem.entity.RoleBindingEntity;

public abstract class RecordInitExcludeRetailer extends BaseRecordInit {
    @Override
    public RecordDetailEntity initRecordDetailFirstPeriod(String downStreamId) {
        RecordDetailEntity recordDetailEntity = new RecordDetailEntity();
        recordDetailEntity.setOrderQuantity(0);
        recordDetailEntity.setOweQuantity(0);
        recordDetailEntity.setAccumulateOweQuantity(0);
        recordDetailEntity.setDownStreamRole(roleBindingEntityMap.get(downStreamId).getRoleType());
        return recordDetailEntity;
    }

    @Override
    public RecordDetailEntity initRecordDetailOtherPeriod(String downStreamId, String userId) {
        RecordDetailEntity recordDetailEntity = new RecordDetailEntity();
        recordDetailEntity.setDownStreamRole(roleBindingEntityMap.get(downStreamId).getRoleType());
        recordDetailEntity.setOrderQuantity(recordEntityMapN.get(downStreamId).getPreReceiverTotal());
        recordDetailEntity.setOweQuantity(recordDetailEntity.getOrderQuantity());
        recordDetailEntity.setAccumulateOweQuantity(recordDetailEntityMapOne.get(userId + downStreamId).getAccumulateOweQuantity() + recordDetailEntity.getOrderQuantity());
        return recordDetailEntity;
    }
    public Integer setAccumulateOweTotal(Integer orderTotal) {
        return 0;
    }
}
